import request from '@/utils/request'

// 创建商品分类
export function createGoodsCat(data) {
  return request({
    url: '/supplier/goods-cat/create',
    method: 'post',
    data: data
  })
}

// 更新商品分类
export function updateGoodsCat(data) {
  return request({
    url: '/supplier/goods-cat/update',
    method: 'put',
    data: data
  })
}

// 更新商品分类
export function updateGoodsCatState(data) {
  return request({
    url: '/supplier/goods-cat/updateState',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function deleteGoodsCat(id) {
  return request({
    url: '/supplier/goods-cat/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品分类
export function getGoodsCat(id) {
  return request({
    url: '/supplier/goods-cat/get?id=' + id,
    method: 'get'
  })
}

// 获得商品分类分页
export function getGoodsCatPage(query) {
  return request({
    url: '/supplier/goods-cat/page',
    method: 'get',
    params: query
  })
}

// 获得商品分类集合
export function getGoodsCatList(query) {
  return request({
    url: '/supplier/goods-cat/list',
    method: 'get',
    params: query
  })
}

// 导出商品分类 Excel
export function exportGoodsCatExcel(query) {
  return request({
    url: '/supplier/goods-cat/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
